package com.cssy.yd.basic.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Service;

import com.byd.acegiext.domain.User;
import com.cssy.yd.basic.dao.BasicStorageinfoTypeDAO;
import com.cssy.yd.basic.entity.BasicStorageinfoDO;
import com.cssy.yd.basic.entity.BasicStorageinfoTypeDO;
import com.cssy.yd.basic.service.IBasicStorageInfoTypeService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;
import com.plat.util.IDCodeTypeUtil;


@Service("basicwhTypeService")
public class BasicStorageTypeServiceImpl implements IBasicStorageInfoTypeService{

	@Resource(name="basicStorageinfoTypeDAO")	
	private BasicStorageinfoTypeDAO basicStorageinfoTypeDAO;
	
	@Override
	public SearchResult findListByExample(SearchConditions scs)
			throws SyBaseException {
		SearchResult rs=new SearchResult(scs);
		List<BasicStorageinfoTypeDO>  list=basicStorageinfoTypeDAO.find(scs);
		rs.setRecordCount(basicStorageinfoTypeDAO.count(scs));
		rs.setResults(list);
		return rs;
	}

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		// TODO Auto-generated method stub
		basicStorageinfoTypeDAO.deleteBasicStorageinfoTypeDOByPrimaryKey(id);
		return null;
	}

	@Override
	public Integer update(BasicStorageinfoTypeDO t, User user)
			throws SyBaseException {
		t.setDuuser(user.getName());
		t.setDutime(new Date());
		return basicStorageinfoTypeDAO.updateBasicStorageinfoTypeDO(t);
	}

	@Override
	public BasicStorageinfoTypeDO save(BasicStorageinfoTypeDO t, User user)
			throws SyBaseException {
		t.setDcruser(user.getName());
		t.setDctime(new Date());
		t.setId(IDCodeTypeUtil.getId());
		basicStorageinfoTypeDAO.insertBasicStorageinfoTypeDO(t);
		return t;
	}

	@Override
	public BasicStorageinfoTypeDO findListById(String id)
			throws SyBaseException {
		// TODO Auto-generated method stub
		return basicStorageinfoTypeDAO.findBasicStorageinfoTypeDOByPrimaryKey(id);
	}

	@Override
	public List<BasicStorageinfoTypeDO> findListByExample(
			BasicStorageinfoTypeDO bTypeDO) throws SyBaseException {
		return basicStorageinfoTypeDAO.findListByExample(bTypeDO);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}

	



	

}
